package com.ssm.service.provider;

import com.ssm.dao.ProviderMapper;
import com.ssm.pojo.Provider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ProviderServiceImpl implements ProviderService {
    @Autowired
    @Qualifier("providerMapper")
    private ProviderMapper providerMapper;
    @Override
    public List<Provider> getProviderList(String proCode, String proName, int offset, int pageSize) {
        return providerMapper.getProviderList(proCode, proName, offset, pageSize);
    }

    @Override
    public Integer getProviderCount(String proCode, String proName) {
        return providerMapper.getProviderCount(proCode,proName);
    }

    @Override
    public int addProvider(Provider provider) {
        return providerMapper.addProvider(provider);
    }

    @Override
    public Provider getProviderByProCode(String proCode) {
        return providerMapper.getProviderByProCode(proCode);
    }

    @Override
    public Provider getProviderById(Integer id) {
        return providerMapper.getProviderById(id);
    }

    @Override
    public int modifyProvider(Provider provider) {
        return providerMapper.modifyProvider(provider);
    }

    @Override
    public int deleteProvider(Integer id) {
        return providerMapper.deleteProviderById(id);
    }

    @Override
    public List<Provider> getAllProvider() {
        return providerMapper.getAllProvider();
    }
}
